'use strict';
// banner 
module.exports = {
  up: async (queryInterface, Sequelize) => {
    const { INTEGER, STRING, DATE, ENUM } = Sequelize;
    // 创建表
    await queryInterface.createTable('banner', {
      id: {
        type: INTEGER(30).UNSIGNED,
        primaryKey: true,
        autoIncrement: true
      },
      title: {
        type: STRING(200),
        allowNull: false,
        defaultValue: '',
        comment: '图片名称',

      },
      path_url: {
        type: STRING(200),
        allowNull: false,
        defaultValue: '',
        comment: '跳转路径',
      },
      sort: {
        type: INTEGER(30),
        allowNull: false,
        defaultValue: '1',
        comment: '排序 越小越前',

      },
      image_url: {
        type: STRING(200),
        allowNull: false,
        defaultValue: '',
        comment: '图片路径',
      },
      statr_time: {
        type: DATE,
        allowNull: false,
        defaultValue: 0,
        comment: '开始时间',
      },
      end_time: {
        type: DATE,
        allowNull: false,
        defaultValue: 0,
        comment: '结束时间',
      },
      operation: {
        type: STRING(20),
        allowNull: false,
        defaultValue: '0',
        comment: '操作者',
      },
      created_at: DATE,
      updated_at: DATE,
    });
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.dropTable('banner');
  }
};
